Conventionally, there is a game apparatus described in Japanese Laid-Open Patent Publication No. 2005-253724 (hereinafter referred to as Patent Document 1) as an example of an apparatus in which a user performs an input operation using an input device comprising an image capturing device. The game apparatus is a shooting game apparatus in which a gunfight is performed against an enemy displayed on a screen. A gun unit (input device) includes a CCD camera. The CCD camera captures an image of surroundings of markers (light emitting diodes) provided at the screen. Data of the image captured by the CCD camera is transmitted from the gun unit to the game apparatus. The game apparatus uses the image data transmitted from the gun unit to specify positions of the markers on the captured image, and based on the specified positions, calculates coordinates of a point of impact for the gun unit. The coordinates of the point of impact are coordinates of an intersection of a line extended in the aiming direction from the barrel of the gun unit and the screen. According to the game apparatus, a player can point at any position (coordinates of a point of impact) on the screen using the input device (gun unit).
The game apparatus also determines whether or not the calculated coordinates of a point of impact are positioned on the screen so as to determine whether or not the input device points an appropriate position, i.e., whether or not the sight of the gun unit is positioned within the screen.
When an input device with which the user can point at any position, such as the gun unit for the game apparatus above, is used, a position (pointing position) pointed using the input device may go outside the screen while the user is not aware of it. When the pointing position goes outside the screen, it is preferable to notify the user that the pointing position is out of the screen, and of a direction in which the pointing position is deviated.
In Patent Document 1, the calculated coordinates of a point of impact are used to determine whether or not the input device points an appropriate position. Therefore, if the image of the marker is not captured, and therefore, the coordinates of a point of impact cannot be calculated, the determination cannot be executed. In other words, when the input device is moved to a position where the image of the light emitting diode cannot be captured, the game apparatus cannot execute the determination, and therefore, cannot notify the user of a direction in which the pointing position is deviated.
Therefore, a feature of certain exemplary embodiments is an information processing apparatus and an information processing program which can notify the user that a position pointed using an input device is deviated from the screen even when the image of a marker is not captured.
Certain exemplary embodiments have the following aspects to attain the feature mentioned above. Note that reference numerals, additional descriptions and the like inside parentheses in this section indicate correspondence to exemplary embodiments described below for the sake of easy understanding, and are not intended to be limiting in any way.
A first aspect of certain exemplary embodiments is directed to a computer readable storage medium (optical disk 4) storing an information processing program (game program 60) executable by a computer (CPU 10, etc.) included in an information processing apparatus (game apparatus 3). The information processing apparatus can communicate with an input device (controller 5) comprising an image capturing means (image capturing device) for capturing an image of a target object (markers 6R and 6L), and calculate a pointing position on a screen of a display device (television 2) based on the image captured by the image capturing means. The input device comprises a motion detecting means (acceleration sensor 37) for detecting a motion of the input device. The information processing program causing the computer to execute a tilt calculating step (S3), a determination step (S4), a comparison step (S8), and a notification step (S9, S10). The tilt calculating step calculates a tilt value (t) indicating a tilt of the input device using a result (acceleration data 62) of detection by the motion detecting means. The determination step determines whether or not the pointing position can be calculated based on the image captured by the image capturing means. The comparison step compares the tilt value calculated by the tilt calculating step with a predetermined reference value (c) when it is determined that the pointing position cannot be calculated. The notification step notifies a user of information about the tilt of the input device, depending on a result of the comparison step.
In a second aspect, the tilt calculating step and the determination step may be repeatedly executed. The information processing program causes the computer to further execute a reference value calculating step (S7). The reference value calculating step calculates the reference value based on one or more tilt values calculated while it is determined that the pointing position can be calculated.
In a third aspect, the information processing program causes the computer to further execute a range calculating step (S6). The range calculating step calculates a tilt range (recognition range) including at least some of the one or more tilt values based on the one or more tilt values calculated while it is determined that the pointing position can be calculated. In the reference value calculating step, the computer calculates the reference value based on the tilt range.
In a fourth aspect, in the reference value calculating step, the computer may calculate an average value between an upper limit value and a lower limit value of the tilt range as the reference value.
In a fifth aspect, in the range calculating step, the computer may change the tilt range so that an upper limit value (maximum value max) and a lower limit value (minimum value min) of the tilt range are brought closer to the tilt value, every time the tilt value is calculated.
In a sixth aspect, the information processing program may cause the computer to further execute a change amount calculating step (S31) of calculating an amount of a change in a position and/or an attitude of the input device. In this case, in the range calculating step, the computer increases a degree by which the upper limit value and the lower limit value of the tilt range are brought closer to the tilt value, with a decrease in the change amount.
In a seventh aspect, in the change amount calculating step, the computer may use, as the change amount of the input device, an amount of a change in the pointing position calculated based on the image captured by the image capturing means.
In an eighth aspect, the information processing program may cause the computer to further execute a storage step. The storage step stores a tilt value calculated during a predetermined period of time from the present to the past, of the one or more tilt values calculated while it is determined that the pointing position can be calculated, into a storage means (main memory 13) of the information processing apparatus. In this case, in the reference value calculating step, the computer calculates the reference value based on a tilt value stored in the storage means when it is determined that the pointing position cannot be calculated.
In a ninth aspect, in the reference value calculating step, the computer may use a most recent tilt value of the one or more tilt values calculated while it is determined that the pointing position can be calculated, as the reference value.
In a tenth aspect, in the reference value calculating step, the computer may set the reference value so as to follow the calculated tilt value, depending on the calculation of the tilt value.
In an eleventh aspect, the tilt value may be represented as any of an angle value (θ) of the input device where a predetermined direction (a direction parallel to the ground; in other words, a direction perpendicular to the gravity direction) is a reference, a value (t=sin θ) of a sine function of the angle value, and a value of a cosine function of the angle value.
In a twelfth aspect, in the notification step, the computer may notify of a direction in which the input device is deviated from a direction in which the image capturing means can capture the image of the target object.
In a thirteenth aspect, the motion detecting means may be an acceleration sensor (37) for detecting an acceleration applied to the input device. In this case, in the tilt calculating step, the computer calculates or acquires the tilt value using a result of detection by the acceleration sensor.
Certain exemplary embodiments may also be provided in the form of an information processing apparatus having a function similar to that of the information processing apparatus for executing the above-described steps.
According to the first aspect, the computer of the information processing apparatus calculates the tilt of the input device using the detection result of the motion detecting means. When it is determined that the pointing position cannot be calculated, information about the tilt of the input device is output using the calculated tilt value. Thereby, even when the pointing position cannot be calculated, the tilt of the input device can be calculated. Therefore, even in such a case, it is possible to notify the user that the pointing position of the input device is deviated from the screen. Also, based on the calculated tilt, it is possible to notify the user of a direction in which the pointing position is deviated.
According to the second aspect, the reference value is calculated based on the tilt value calculated while it is determined that the pointing position can be calculated. Therefore, the tilt which enables actual calculation of the pointing position is used to execute determination in the determination step, whereby the determination is correct.
According to the third aspect, the tilt range is calculated based on the tilt value calculated while it is determined that the pointing position can be calculated, and the reference value is determined based on the tilt range. Thereby, it is possible to correctly calculate the reference value.
According to the fourth aspect, the average value between the upper limit value and the lower limit value of the tilt range is used as the reference value. Therefore, the reference value can correctly indicate a tilt which enables calculation of the pointing position. Thereby, it is possible to more correctly execute determination in the determination step.
According to the fifth aspect, the tilt range is changed so that the upper limit value and the lower limit value are brought closer to the tilt value, every time the tilt value is calculated. Thereby, for example, even when the tilt range of the input device in which the pointing position can be calculated is changed due to a change in the attitude of the user during an operation using the input device, the tilt range can be appropriately set, depending on the change in the range.
According to the sixth aspect, the degree by which the upper limit value and the lower limit value of the tilt range are brought closer to the tilt value is increased with a decease in the change amount of the input device. Here, when the change amount of the input device is small, the motion of the controller 5 is not rapid, so that the detection result of the motion detecting means relatively correctly indicates the tilt of the input device. Therefore, the tilt value calculated based on the detection result in this case is considered to be correct. In the sixth aspect, when the tilt value is correct, a degree to which the tilt value reflects on the tilt range is increased. When the tilt value is not correct, the degree to which the tilt value reflects on the tilt range is decreased. Thereby, it is possible to more correctly calculate the tilt range.
According to the seventh aspect, the change amount of the pointing position is used as the change amount of the input device, thereby making it possible to correctly calculate the change amount of the input device.
According to the eighth aspect, the reference value is calculated based on a tilt value calculated during a predetermined period of time from the present to the past, of the one or more tilt values calculated while it is determined that the pointing position can be calculated. Thereby, as in the fifth aspect, for example, even when the attitude of the user is changed during an operation using the input device, the reference value can be appropriately set, depending on the change.
According to the ninth aspect, the most recent tilt value of the one or more tilt values calculated while it is determined that the pointing position can be calculated is used as the reference value, thereby making it possible to correctly set the reference value.
According to the tenth aspect, the reference value is set so as to follow the calculated tilt value. Therefore, as in the fifth and eighth aspects, even when the attitude of the user is changed during an operation using the input device, the reference value can be appropriately set, depending on the change.
According to the eleventh aspect, the tilt value is represented as an angle value of the input device where a predetermined direction is a reference, a value of a sine function of the angle value, or a value of a cosine function of the angle value. Thereby, the tilt of the input device can be represented in a simple form. Therefore, for example, as compared to when the tilt is represented by a vector, the computation process of the tilt value can be facilitated.
According to the twelfth aspect, information about a direction in which the input device is deviated from a direction in which the image capturing means can capture the image of the target object, is presented to the user. Thereby, the user can easily know a direction in which the input device is turned.
According to the thirteenth aspect, an acceleration sensor is used as the motion detecting means, thereby it is possible to easily calculate the tilt of the input device.
These and other features, aspects and advantages of certain exemplary embodiments will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.